package com.xiaowu.xblog.web;

import com.xiaowu.xblog.model.SystemVersionVO;
import com.xiaowu.xblog.utils.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/api/system")
@Tag(name = "系统信息")
public class SystemVersionController {

    @Value("${project.version}")
    private String version;

    @Value("${project.build-time}")
    private String buildTime;

    @Value("${project.author}")
    private String author;


    @Operation(summary = "显示系统信息")
    @GetMapping("/version")
    public Result<SystemVersionVO> getVersionInfo() {
        return Result.success(new SystemVersionVO(version, buildTime, author));
    }
}
